package com.lc.user.express.httpserver;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/3/30.获取验证码
 */
@HttpInlet(Net.GET_CODE)
public class GetVerfyCode extends ZJDBAsyGet<GetVerfyCode.Info> {
    public String mobile;

    public GetVerfyCode(String mobile, AsyCallBack listener) {
        super(listener);
        this.mobile = mobile;
    }

    @Override
    protected Info parser(JSONObject object) {
        if (object.optInt("message") == 1) {
            Info info = new Info();
            info.code = object.optString("code");
            TOAST = "发送验证码成功";
            return info;
        } else {
            TOAST = "获取验证码失败";
        }
        return null;
    }

    public static class Info {
        public String code;
    }
}